/**
 *  iBizSys 5.0 机器人生产代码（不要直接修改当前代码）
 *  http://www.ibizsys.net
 */
package com.sa.litetwo.app.card.ctrlhandler;


import java.util.ArrayList;
import java.util.List;
import net.ibizsys.paas.util.StringHelper;
import net.ibizsys.paas.web.WebContext;
import net.ibizsys.paas.demodel.DEModelGlobal;
import net.ibizsys.paas.demodel.IDataEntityModel;
import net.ibizsys.paas.service.IService;
import net.ibizsys.paas.service.ServiceGlobal;

import com.sa.litetwo.app.srv.card.ctrlmodel.GG_OTHERMainMULTIEDITVIEWPANELModel;
import com.sa.litetwo.srv.card.demodel.GG_OTHERDEModel;
import com.sa.litetwo.srv.card.service.GG_OTHERService;
import com.sa.litetwo.srv.card.dao.GG_OTHERDAO;
import com.sa.litetwo.srv.card.entity.GG_OTHER;

import net.ibizsys.paas.core.DEDataSetFetchContext;
import net.ibizsys.paas.ctrlmodel.IGridModel;
import net.ibizsys.paas.db.DBFetchResult;
import net.ibizsys.paas.web.AjaxActionResult;
import net.ibizsys.paas.web.MDAjaxActionResult;
import net.ibizsys.paas.entity.IEntity;

public class GG_OTHERMEditView9MeditviewpanelHandler extends net.ibizsys.paas.ctrlhandler.GridHandlerBase{

    protected GG_OTHERMainMULTIEDITVIEWPANELModel gridModel = null;
    public GG_OTHERMEditView9MeditviewpanelHandler()  {
        super();
    }

     @Override
    protected void onInit() throws Exception
    {
         this.setMinorSortField("ZTMS");
    	 this.setMinorSortDir("DESC");
        gridModel = (GG_OTHERMainMULTIEDITVIEWPANELModel)this.getViewController().getCtrlModel("meditviewpanel");
    	super.onInit();
    	

    }
    
       @Override
	protected IGridModel getGridModel()
	{
		return this.getRealGridModel();
	}
    
    protected GG_OTHERMainMULTIEDITVIEWPANELModel getRealGridModel(){
    	return this.gridModel;
    }

       protected GG_OTHERService getRealService(){
            return (GG_OTHERService)this.getService();
       }


      @Override
	protected DBFetchResult fetchDEDataSet(DEDataSetFetchContext deDataSetFetchContext) throws Exception
	{
             return  this.getRealService().fetchTempDefault(deDataSetFetchContext);
	}

    @Override
    protected IEntity getDraftEntity()throws Exception
    {
    	GG_OTHER entity = new GG_OTHER();
        getDraftEntity(entity);
        return entity;
    }

    protected void getDraftEntity(GG_OTHER entity)throws Exception
    {
    	this.getRealService().executeAction(GG_OTHERService.ACTION_GETDRAFTTEMP,entity);
    }

      @Override
    protected IEntity getEntity(Object objKeyValue)throws Exception
    {
    	GG_OTHER entity = new GG_OTHER();
        entity.set(GG_OTHER.FIELD_GG_OTHERID,objKeyValue);
        this.getRealService().executeAction(GG_OTHERService.ACTION_GETTEMP,entity);
        return entity;
    }


    @Override
    protected IEntity createEntity(IEntity iEntity)throws Exception
    {
        this.getRealService().executeAction(GG_OTHERService.ACTION_CREATETEMP,iEntity);
        return iEntity;
    }

    @Override
    protected IEntity updateEntity(IEntity iEntity)throws Exception
    {
        this.getRealService().executeAction(GG_OTHERService.ACTION_UPDATETEMP,iEntity);
        return iEntity;
    }

      @Override
    protected void removeEntity(Object objKeyValue)throws Exception
    {
    	GG_OTHER entity = new GG_OTHER();
        entity.set(GG_OTHER.FIELD_GG_OTHERID,objKeyValue);
        this.getRealService().executeAction(GG_OTHERService.ACTION_REMOVETEMP,entity);
    }


        @Override
	public int getTempMode()
	{
	     return TEMPMODE_MINOR;
	}





}